home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(load){
- if(_name != "amoebaShot")
- {
- _Y = _root.amoeba._y;
- _X = _root.amoeba._x;
- shotSpeed = 10;
- shotTime = getTimer();
- deltaX = _X - _root.ship._x;
- deltaY = _Y - _root.ship._y;
- angle = - Math.atan2(deltaX,deltaY);
- ySpeed = shotSpeed * Math.cos(angle);
- xSpeed = shotSpeed * Math.sin(angle);
- amoebaShot = new Sound(this);
- amoebaShot.attachSound("amoebaShot");
- amoebaShot.setVolume(20);
- amoebaShot.start();
- }
- }
-